package com.share.common.utils.plugin.applicationEvent.example;

import java.io.IOException;
import java.util.Date;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	public static void main(String args[]) throws IOException{
	
		@SuppressWarnings("resource")
		ApplicationContext context=new ClassPathXmlApplicationContext("config/utils/plugin/bean-event.xml");
		Message message=new Message();
	    message.setContent("****###@@@911事件@@@###***");
	    message.setEmail("yeyi0909@google.com");
	    message.setSendTime(new Date());
	    ApplicationEvent sendEmailEvent=new SendEmailEvent("SendEmailEvent",message);
		context.publishEvent(sendEmailEvent);
	}
}
